package org.mybatis;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:/spring-mybatis.xml"})
public class MybatisTest {



    @Resource(name = "sqlSession")
    SqlSessionTemplate sqlSessionTemplate;

    @Test
    public void test(){
        Object one = sqlSessionTemplate.selectOne("org.mybatis.mapper.UserMapper.queryUser",1);
        Object two = sqlSessionTemplate.selectOne("org.mybatis.mapper.UserMapper.queryUser",1);
        System.out.println(one);
        System.out.println(two);

    }



}
